package com.coco.seck.controller;

import com.coco.common.annotation.IngoreResponseAdvice;
import com.coco.common.result.CommonResponse;
import com.coco.seck.service.SeckillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @author HanSama
 * @date 2021年07月16日 15:47
 */
@RestController
@RequestMapping("/seck/kill")
@IngoreResponseAdvice
public class SeckKillController {

    @Autowired
    private SeckillService seckillService;


    @RequestMapping("/doSeckill/{uid}/{gid}")
    public CommonResponse doSeckKill(@PathVariable Integer uid, @PathVariable Integer gid) throws ParseException {
        return seckillService.doSeckKill(uid,gid);
    }

    @RequestMapping("/addSeckGoods")
    public String addSeckGoods(){
        return seckillService.addSeckGoods();
    }
}
